//创建地图对象，这里默认使用北京的经纬度作为地图的中心
var divMap = new BMap.Map("bmapcontainer");
//var point = new BMap.Point(121.481,31.236812);
//map.centerAndZoom(point,13);
//divMap.centerAndZoom(cityPostion,13);
//divMap.enableScrollWheelZoom();
//自动联系对象创建的参数
var options = {
	input: "startpoint",
	location: divMap,
	onSearchComplete:searchComplete
};
//建立一个自动完成的对象
var ac = new BMap.Autocomplete(options);
ac.addEventListener("onconfirm", function(e) {
	//alert(e);
});

function searchComplete(result){
	 /*result = ac.getResults();
	 var resultInfo = "自动查询信息：<br/>";
	//这里必须通过先得到结果集的总数，
	//然后才能去循环异步结果集
	 var count = result.getNumPois();
	 if(count>0){
		for(i = 0; i<=count -1 ;i++){
		   var poi = result.getPoi(i);
		   resultInfo += poi.district +poi.street +  poi.business+"<br/>";
		}
	   //将所有自动匹配的结果显示到网页上id为//searchResultPanel的标签里
	 }*/
}
var options1 = {
	input: "endpoint",
	location: cityPostion,
	onSearchComplete:searchComplete1
};
debugger
if(typeof(lxyzyong)=="undefined")
//建立一个自动完成的对象
	var ac1 = new BMap.Autocomplete(options1);
function searchComplete1(result){
	 /*result = ac1.getResults();
	 var resultInfo = "自动查询信息：<br/>";
	//这里必须通过先得到结果集的总数，
	//然后才能去循环异步结果集
	 var count = result.getNumPois();
	 if(count>0){
		for(i = 0; i<=count -1 ;i++){
		   var poi = result.getPoi(i);
		   resultInfo += poi.district +poi.street +  poi.business+"<br/>";
		}
	   //将所有自动匹配的结果显示到网页上id为//searchResultPanel的标签里
	 }*/
}